import 'package:flutter_cwhisky/bean/good_entity.dart';
import 'package:flutter_cwhisky/generated/json/base/json_field.dart';
import 'package:flutter_cwhisky/generated/json/good_list_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class GoodListEntity {
  String? code;
  String? message;
  GoodListData? data;
  int? currentTime;

  GoodListEntity();

  factory GoodListEntity.fromJson(Map<String, dynamic> json) => $GoodListEntityFromJson(json);

  Map<String, dynamic> toJson() => $GoodListEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class GoodListData {
  int? total;
  int? size;
  int? pages;
  int? current;
  bool? prev;
  bool? next;
  List<GoodEntity>? records;
  String? subImage;
  String? name;
  String? colorStart;
  String? colorEnd;

  GoodListData();

  factory GoodListData.fromJson(Map<String, dynamic> json) => $GoodListDataFromJson(json);

  Map<String, dynamic> toJson() => $GoodListDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
